const db = wx.cloud.database()
const todos = db.collection('todos')

Page({

  onSubmit:function(event){
    console.log(event);
    todos.add({
      data: {
        title:event.detail.value.title
      }
    }).then(res => {
      console.log(res)
      wx.showToast({
        title:"Success",
        icon:'success'
      })
    })
  }
})